package gxwl.user.controller;

import cn.hutool.core.lang.tree.Tree;
import gxwl.common.pojo.CommonResult;
import gxwl.user.service.DictService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Validated
@RequiredArgsConstructor
@RequestMapping("/gxwl/api/dic")
public class Dict {
    private final DictService dictService;
    /***
     * @description: 获取所有字典树
     *
     * @author: baijhc
     * @date: 2024/3/20 17:03
     **/
    @ApiOperation("获取所有字典树")
    @GetMapping("/tree-all")
    public CommonResult<List<Tree<String>>> treeAll() {
        return CommonResult.data(dictService.treeAll());
    }
}
